package com.laicunba.service.baofoo;

import java.math.BigDecimal;

import com.laicunba.service.accounting.FuiouBuyService;
import com.laicunba.util.StringUtil;

public interface BaofooService extends FuiouBuyService {

	public class BuildWapFormParam {
		public final String txnSubType = "01";
		public final String bizType = "0000";
		public String payCode;
		public String accNo;
		public String idCard;
		public final String idCardType = "01";
		public String idHolder;
		public String mobile;
		public String transId;
		public String txnAmt;
		public String commodityName;
		public String pageUrl;
		public String returnUrl;
		public String additionalInfo;
		public String reqReserved;
		public String backUrl;
	}

	public class PayResult {
		public String respCode;
		public String respMsg;
		public String memberId;
		public String terminalId;
		public String dataType;
		public String transId;
		public String transNo;
		public BigDecimal succAmt;

		public boolean isFromBaofooServer() {
			return StringUtil.isNotEmpty(respCode, transId);
		}

		public boolean isPaySuccess() {
			return "0000".equals(respCode);
		}

		@Override
		public String toString() {
			return "PayResult [respCode=" + respCode + ", respMsg=" + respMsg + ", memberId=" + memberId + ", terminalId=" + terminalId + ", dataType=" + dataType + ", transId=" + transId + ", transNo=" + transNo + ", succAmt=" + succAmt + "]";
		}

	}

	public String buildWapForm(BuildWapFormParam param);

	public PayResult parsePayResult(String dataContent);
}
